home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
fld2_16
/
folders2.bas
< prev
Wrap
BASIC Source File
|
1994-12-31
|
53KB
|
1,345 lines
' FOLDERS-II v1.6 by Antonio Cordero. Original module by James Parr.
' This module is Public Domain
' This module allows you to use Folders without the need of a VBX control.
' The differences of version 1.0 with the original module by James Parr are
' the following:
' - 3D
' - More than a folder per form
' - Can use panels at the same time as folders
' - The Tabs text don't overwrite if too large
' - If more than a Tab row, the folder will adjust its position to see all of them
' - You can enable/disable each Tab
' - Accelerators to change the current Tab
' Version 1.5:
' - Better support of form colors, no more necessary to be bright gray
' - FolderEnable, FolderDisable, FolderEnabled()
' - Can put a graphic in each Tab in every position: Left, Right, Top, Bottom
' - Better use of panel's area. Only the Caption is overwritten
' - Support for Folders inside Folders
' - Tab styles: Normal (Chamfered), Slanted, Chicago
' - Can specify offset between rows
' - Name changes:
' CurrentFolder() become CurrentTab()
' NumFolders() become NumTabs()
' - Can share controls over all the Tabs of a Folder using SetFixedControl
' - TightenForm modified: don't change vertical position and allows space below
' - Multiple lines titles
' - Can know which Tab has been clicked before and after the change
' Version 1.6:
' - First international version. Being released to the Internet
' - Changes and corrections to comments when traducing to English
' - Disabled graphics are a lot faster
' - New effect: 3D border selectable at left/right side of folder
' - New functions: FolderLeft, FolderTop, FolderWidth, FolderHeight
' - New sub: FolderMove
' - Bug with colors in folder with more than one row if inside a container
' - Corrected some other drawing bugs (too many)
' - New sub: ReDefineFolder
' - Can change number of tabs at runtime
' - New effect: overlapped or separated tabs
' - Colored Tabs (Compatibility WARNING: see FloodColor/ForeColor prop. below)
' - Changed: folders inside folders need to be inside a picturebox
' (problem with SSPanels not having ScaleMode property)
' - Can redefine X offset of Tabs diagonals in the Style parameter
' For any sugerence or bug i can be reached at:
' - Internet E-mail: ccanto@eui.upm.es
' - "Las Profundidades del DEMo╤O" or ...uh..."The Deepnesses of the DEM'N" :-)
' +34(Spain)-1(Madrid)-7300942 (put message to cosysop NetDevil)
' Form of use:
' ------------
' Create as much SSPanels (THREED.VBX) as tabs you want in the folder, all in a control array.
' If you want to use multiple lines captions, use "\$" as line separator.
' Put the following properties to the SSPanels:
' Caption = the Tab title
' Alignment = 0 - (Left Justify) - TOP
' BevelInner = 0 - none
' BevelOuter = 2 - raised
' BevelWidth = 2
' BorderWidth = 2
' Outline = True
' RoundedCorners = False
' Tag = folder identification, maybe the panels name
' BackColor = as you like
' FloodColor = background color for the tab
' (use the same as BackColor to be compatible with previous versions)
' ForeColor = foreground color for the tab
'
' Create two PictureBoxes that you will pass as parameters to DefineFolders. No
' properties needed.
'
' If you want to use graphics in the tabs, create a control array of PictureBoxes that
' contain the graphics and with the Tag property the same as of the panels. If any of
' the PictureBoxes have no graphic (Picture=(none)) the corresponding tab will have
' no graphic. But you must make an array of N pictureboxes being N the number of
' panels.
' Put in Form1.Load:
' Success% = DefineFolders (Index, NumTabsPerRow, Panel3D(0), FoldersTag,
' TabPicture1, TabPicture2, Container, TabStyle,
' RowOffset, PicturesPosition, GrayPictures,
' LeftBorder, BetweenTabs)
' The parameters are:
' Index : index of the folder in the program, 0 to 49
' NumTabsPerRow : number of Tabs per row :). 0 means all in one row.
' Panel3D(0) : first element of an array of 3D panels created as said above.
' Index 0 panel will be the base for the others.
' FoldersTag : tag common to all the panels of the folder. Allows you to have
' other SSPanels in the same form assuming that they don't have
' this tag. It also allows you to put more than one folder in
' the form.
' TabPicture1 y TabPicture2 : the pictures created as said above.
' Container : keyword Nothing if the folder is directly in a Form, or, the
' container control. The container control must have the ScaleMode
' property, so the best choice is a PictureBox.
' TabStyle : low byte: 0 = Chamfered, 1 = Slanted, 2 = Chicago
' high byte: X offset of Tabs diagonals (0=default) (pixels)
' (only for Chamfered and Slanted, i.e. &H0601 = Slanted
' with diagonal.X = 6)
' RowOffset : horizontal offset between rows (pixels).
' PicturesPosition : graphics position: 0 = Left, 1 = Right, 2 = Top, 3 = Bottom
' GrayPictures : True if the graphics must be grayed when disabled.
' LeftBorder : True if the 3D border of not-first rows is at the left side.
' BetweenTabs : number of pixels between tabs. Can be negative to make
' overlapped tabs (pixels).
' If you want to use accelerators to access a tab, make form1.KeyPreview = TRUE
' and put in form1.KeyUp:
' keycode = GotoFolderByAccel(Index, keycode, shift)
' Being Index the folder index in the program
'
' WARNING: If you click the keys to access a tab and that tab is the current,
' the control who have the focus could be activated (clicked).
' The solution is to make the TabStop property to False in all the
' controls of the folder.
' Put in TabPicture1.MouseUp:
' FolderClick Index, Button, X, Y
' or:
' i = FolderClickFn (Index, Button, X, Y)
' Being Index the index to the folder (0-49).
' The function FolderClickFn returns the selected tab (0 is first)
' Your can use the function FolderClicked(Index, X, Y) before FolderClick or
' FolderClickFn to know which tab will be selected before it changes.
' If you want to use shared controls, create them in the first panel (index 0)
' and, in Form1.Load, after the DefineFolders command:
' SetFixedControl Index, Control
' for each shared control (if a control is inside a container, only use
' SetFixedControl with the container), being Index the index to the folder
' in the program. Also put in Form1.Unload:
' ResetFixedControls Index
' Controls of types Label, Shape, Line, Image, and others without hWnd property
' cannot be shared, but you can share them if you put them inside a container
' that have a hWnd property, a picturebox, for example.
' The best method to share controls is to put them inside a PictureBox and then
' share only this PictureBox.
' You can use the following routines (Index is the index of the folder):
' n = CurrentTab (Index) : gets the current tab
' n = NumTabs (Index) : gets the number of tabs in the folder
' NextFolder Index : displays the next tab
' PrevFolder Index : displays the previous tab
' GotoFolder Index, TabNumber : displays the tab TabNumber (first is 0)
' TightenForm Index, BelowSpace, NoBorders : adjusts the form around the folder
' with BelowSpace below the folder and
' optional visible borders.
' TabEnable Index, TabNumber : enables the tab TabNumber
' TabDisable Index, TabNumber : disables the tab TabNumber
' flag% = TabEnabled (Index, TabNumber) : returns TRUE if the tab TabNumber
' is enabled
' FolderEnable Index : enables the folder
' FolderDisable Index : disables the folder
' flag% = FolderEnabled (Index) : returns TRUE if the folder is en